from django.contrib import admin
from .models import UserDb,LeavDb,collectionDb
from import_export.admin import ImportExportModelAdmin


class UserDbAdmin(admin.ModelAdmin):
    list_display = ('user_id','user_name','autograph','image_data')
    readonly_fields = ("image_data",)  # 必须加这行 否则访问编辑页面会报错
    list_per_page = 10


class LeavDbAdmin(admin.ModelAdmin):
    list_display = ('leav_id','user_name','content','praise','sttp_on','create_time','update_time',)
    list_per_page = 10


class collectionDbAdmin(admin.ModelAdmin):
    list_display = ('menu_name','user_id','create_time','update_time','image_data',)
    readonly_fields = ("image_data",)  # 必须加这行 否则访问编辑页面会报错
    list_per_page = 10


admin.site.register(UserDb,UserDbAdmin)
admin.site.register(LeavDb,LeavDbAdmin)
admin.site.register(collectionDb,collectionDbAdmin)
